﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace InfonavaEye.Service
{
    public class ReportServiceFactory
    {
        private static IReportService defaultService = null;
        private static List<IReportService> reportServiceList = new List<IReportService>();
        static ReportServiceFactory() {
            if (reportServiceList.Count==0) {
                defaultService = new CommonReportService();
                reportServiceList.Add(defaultService);
            }
        }
        /// <summary>
        /// 获取service
        /// （根据配置文件中Config.UPPER_SYSTEM_CODE，来确定用哪个service）
        /// </summary>
        /// <returns></returns>
        public static IReportService getService() {

            var service = reportServiceList.FindLast(p=>p.filter(Eps.Ai.Common.Config.UPPER_SYSTEM_CODE));
            if (service == null ) {
                return defaultService;
            }
            return service;
        }
    }

    /// <summary>
    /// 上位机-系统编码
    /// </summary>
    public class UpperClientCodeConstant {
        public static readonly string OBS_BJZRYHYY = "OBS_BJZRYHYY";//北京中日友好医院
    }
}
